import axios from "axios";
import router from "../router";

const service = axios.create({
  baseURL: "/",
});

service.interceptors.response.use(
  function (response) {
    return response;
  },
  function (error) {
    switch (error.response.status) {
      case 403:
        router.push({ name: "Login" });
        break;
    }
    return Promise.reject(error);
  }
);

export default service;
